
jQuery(document).ready(function (a) {
    a(b);

    function b() {
    	
    	
    	var div = a( '#picker' )[0]; 
    	if ( div ) { 
    		
    	d=a.farbtastic("#picker");

        var e = a("#picker").css("opacity", 0.25);
        var c;
        a(".colorwell").each(function () {
            d.linkTo(this);
            a(this).css("opacity", 0.75)
        }).focus(function () {
            if (c) {
                a(c).css("opacity", 0.75).removeClass("colorwell-selected")
            }
            d.linkTo(this);
            e.css("opacity", 1);
            a(c = this).css("opacity", 1).addClass("colorwell-selected")
        });
        return true
        }else{
    	return false
    	}
    }
    a("#myo-add-option").on("click", function (d) {
        var e = parseInt(a(".myo-option").last().attr("data-myo-option"), 10) + 1;
        var c = parseInt(e) + 1;
        a("#myo-poll-options").append("<br/><label>Option " + c + ': </label><input type="text" class = "myo-option" name="option-' + e + '" value= "" data-myo-option = "' + e + '" ><label for="color' + c + '">Color ' + c + ':</label><input type="text" id="color' + e + '" name="color' + e + '" class="colorwell" value="#edfa00" />');
        a("#myo-options").attr("value", c);
        a(b);
        return true
    })

});